<template>
  <div class="hamburger-container" @click="toggleClick">
    <!-- <i class="iconfont action-item hamburger" :class="icon"></i> -->
    <svg-icon id="guide-hamburger" class="hamburger" :icon="icon"></svg-icon>
  </div>
</template>

<script lang="ts" setup>
import { computed } from 'vue'
import { useGlobalStore } from '@/stores/global'

const global = useGlobalStore()

const toggleClick = () => {
  global.triggerSidebarOpened()
}

// 'hamburger-opened' : 'hamburger-closed'
// 'icon-fold' : 'icon-unfold'
const icon = computed(() => (global.sidebarOpened ? 'hamburger-opened' : 'hamburger-closed'))
</script>

<style lang="scss" scoped>
.hamburger-container {
  padding: 0 16px;
  .hamburger {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
  }
}
</style>
